package com.ticket.sass.admin.dto.output.member;

import com.baomidou.mybatisplus.annotation.TableField;
import com.ticket.sass.common.entity.tenant.MemberCardOrderRecordEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author ywb
 * @date 2024-03-18 17:56
 */
@Data
@ApiModel
public class MemberCardOrderRecordListOutput {
    @ApiModelProperty(value = "流水号")
    private String serialNumber;
    
    @ApiModelProperty(value = "收支类型：1 收入，2 支出")
    private Short flowType;
    
    @ApiModelProperty(value = "交易类型：1 充值，2 购票，3 买卖品，4 退款")
    private Short type;
    
    @ApiModelProperty(value = "交易描述  标题")
    @TableField("\"desc\"")
    private String desc;
    
    @ApiModelProperty(value = "交易金额")
    private BigDecimal amount;
    
    @ApiModelProperty(value = "交易后余额")
    private BigDecimal balance;
    @ApiModelProperty(value = "交易时间")
    public LocalDateTime createdAt;
    
    
    public MemberCardOrderRecordListOutput() {
    }
    
    public MemberCardOrderRecordListOutput(MemberCardOrderRecordEntity entity) {
        this.serialNumber = entity.getSerialNumber();
        this.flowType = entity.getFlowType().getValue();
        this.type = entity.getType().getValue();
        this.desc = entity.getDesc();
        this.amount = entity.getAmount();
        this.balance = entity.getBalance();
        this.createdAt = entity.getCreatedAt();
    }
}
